package com.ls.pattern.structure.adapter.object_adapter;

import com.ls.pattern.structure.adapter.Voltage220V;

public class VoltageAdapter implements IVoltage5V {
    private Voltage220V voltage220V;

    public VoltageAdapter(Voltage220V voltage220V) {
        this.voltage220V = voltage220V;
    }

    @Override
    public int output5V() {

        if (voltage220V != null) {
            int src = voltage220V.output220V();
            int dstV = src / 44;
            return dstV;
        }
        return 0;

    }
}
